package com.example.librarymanagement.vo;

import com.example.librarymanagement.util.DateFormatUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * @author lzx
 */
@Data
@Accessors(chain = true)
public class BorrowRecordTopVo {
    @ApiModelProperty(value = "书id")
    private Integer bookId;

    @ApiModelProperty(value = "中文书名")
    private String cName;

    @ApiModelProperty(value = "书名")
    private String name;

    @ApiModelProperty(value = "借阅数量")
    private Integer number;

    @ApiModelProperty(value = "借阅时间")
    private String borrowDate;

    public void setBorrowDate(Date borrowDate) {
        if (borrowDate != null) {
            this.borrowDate = DateFormatUtil.convertDateToString(borrowDate);
        }
    }
}

